//
//  ATScriptParameter.m
//  AutomationTool
//
//  Created by Laurie Marmon on 2/26/12.
//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//

#import "ATScriptStepParameter.h"

@implementation ATScriptStepParameter

@synthesize name = _name;
@synthesize userDescription = _userDescription;
@synthesize isOptional = _isOptional;
@synthesize possibleValues = _possibleValues;

- (NSString *)description
{
    return [NSString stringWithFormat:@"Name=%@\n PossibleValues=%@", self.name.description, self.possibleValues.description];
}

- (void)encodeWithCoder:(NSCoder *)aCoder {
    [aCoder encodeObject:_name forKey:@"ATParameterName"];
    [aCoder encodeObject:_userDescription forKey:@"ATParameterUserDescription"];
    [aCoder encodeBool:_isOptional forKey:@"ATParameterIsOptional"];
    [aCoder encodeObject:_possibleValues forKey:@"ATParameterPossibleValues"];
}

- (id)initWithCoder:(NSCoder *)aDecoder {
    self = [super init];
    _name = [aDecoder decodeObjectForKey:@"ATParameterName"];
    _userDescription = [aDecoder decodeObjectForKey:@"ATParameterUserDescription"];
    _isOptional = [aDecoder decodeBoolForKey:@"ATParameterIsOptional"];
    _possibleValues = [aDecoder decodeObjectForKey:@"ATParameterPossibleValues"];
    return self;
}
@end
